package com.mgq.design.template;

/**
 * <b>功能：</b>Client<br>
 * <b>Copyright TCSL</b>
 * <li>版本&nbsp;&nbsp;&nbsp;&nbsp;修改日期&nbsp;&nbsp;&nbsp;&nbsp;部　　门&nbsp;&nbsp;&nbsp;&nbsp;作　者&nbsp;&nbsp;&nbsp;&nbsp;变更内容</li><hr>
 * <li>v1.0&nbsp;&nbsp;&nbsp;&nbsp;20220418&nbsp;&nbsp;营业后台&nbsp;&nbsp;&nbsp;&nbsp;马广奇&nbsp;&nbsp;&nbsp;&nbsp;创建类</li>
 * <br><br>
 *
 * @author 马广奇
 * @version 2022-04-18 11:32
 */
public class Client {
    public static void main(String[] args) {
        OnlineBank chinaBank = new ChinaBank();
        OnlineBank agriculturalBank = new AgriculturalBank();
        Customer customer = new Customer();
        chinaBank.processCustomer(customer.getId());
        agriculturalBank.processCustomer(customer.getId());

        //使用lambda来简化模板模式

        System.out.println("-------------------");
        new OnlineBankLambda().processCustomer(customer.getId(), customer1 -> System.out.println("我是中国银行.lambda表达式..."));
        new OnlineBankLambda().processCustomer(customer.getId(),customer1 -> System.out.println("我是农业银行.lambda表达式..."));


    }
}
